<template>
  <div class="word-audio">
    <h3 class="read" @click="$refs.read.play()">
      <slot></slot>
      <el-icon name="video-play"></el-icon>
    </h3>
    <audio ref="read" :src="'http://dict.youdao.com/dictvoice?audio='+word"></audio>
  </div>
</template>

<script>
  export default {
    name: "wordAudio",
    props: ['word']
  }
</script>

<style scoped>
  .read {
    user-select: none;
    cursor: pointer;
    display: flex;
    align-items: center;
  }

  [class*=el-icon] {
    color: #409EFF;
    font-size: 32px;
    margin-left: 10px;
  }
</style>
